#include<bits/stdc++.h>
using namespace std;
const int NN=15;
int T[NN],D[NN],L[NN],vis[NN];
int have_answer;
int n;
void dfs(int x,int tim){
	if (have_answer)return;
	if (x==n){
		have_answer=1;
		return;
	}
	for (int i=1;i<=n;i++){
		if (!vis[i] && T[i]+D[i]>=tim){
			vis[i]=1;
			dfs(x+1,max(T[i],tim)+L[i]);
			if (have_answer)return;
			vis[i]=0;
		}
	}
}
void solve(){
	have_answer=0;
	cin>>n;
	for (int i=1;i<=n;i++){
		cin>>T[i]>>D[i]>>L[i];
		vis[i]=0;
	}
	dfs(0,0);
	if (have_answer)cout<<"YES\n";
	else cout<<"NO\n";
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
} 
